package Test1011;

import java.util.Scanner;

public class Array {
    public static void main(String[] args) {
        //预习数组
        //定义一个整数数组，求数组中所有数的和 以及乘积
        int[] scores = new int[5];
        int sum =0;
        int chengji = 1;
        scores[0] = 1;
        scores[1] = 2;
        scores[2] = 3;
        scores[3] = 4;
        scores[4] = 5;
        for (int i = 0; i < scores.length ; i++) {
            sum += scores[i];

        }
        for (int j = 0; j <scores.length ; j++) {
            chengji *= scores[j];
        }
        System.out.println("数组的和为:"+sum);
        System.out.println("数组的乘积为:"+chengji);







    }
}
